/**
 * Created By zhangQ 2018/5/15
 * [自动生成 全局变量 vuex
 *  1.存放当前选择的数据源字符
 *  2.存放当前选择的表
 *  3.存放当前列的原始数据
 *  4.存放转换的javaBean字段
 * ]
 */

const state = {
  dataSource: {}, // 数据源对象
  tables: []
}

const mutations = {
  SET_DATASOURCE (state, dataSource) {
    state.dataSource = dataSource
  },
  SET_TABLES (state, table) {
    state.tables = table
  }
}

const actions = {
  setDataSource ({ commit }, dataSource) {
    commit('SET_DATASOURCE', dataSource)
  },
  setTables ({ commit }, tableName) {
    commit('SET_TABLES', tableName)
  }
}

export default {
  namespaced: true,
  state,
  mutations,
  actions
}
